package com.mate.cloud.exception;

import com.mate.cloud.common.constant.ResponseEnum;
import com.mate.cloud.common.exception.BusinessRuntimeException;

public class BaseException extends BusinessRuntimeException {

    public BaseException() {
        super();
    }

    public BaseException(String code) {
        super(code);
    }

    public BaseException(String code, String message) {
        super(code, message);
    }

    public BaseException(String code, String... message) {
        super(code, message);
    }

    /**
     * 使用错误码枚举创建异常
     */
    public BaseException(final ResponseEnum errorMessage) {
        this(String.valueOf(errorMessage.getCode()), errorMessage.getLocalMessage());
    }

    public BaseException(Throwable cause) {
        super(cause);
    }
}
